package alex.rsx.view;

import java.util.List;
import java.util.Vector;

import alex.rsx.activity.r.R;
import alex.rsx.util.TestData;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.alex.books.BaseBook;

/**
 * 
 * 书架列表
 * 
 * @author Alex.Lu
 *
 */
public class IndexRecommodAdapter extends BaseAdapter {

	private List<String> mBooks;
	private LayoutInflater mLayoutInflater;

	
	public IndexRecommodAdapter(Context context){
		mLayoutInflater = LayoutInflater.from(context);
		mBooks = TestData.testList();
	}
	@Override
	public int getCount() {
		// TODO Auto-generated method stub
		return mBooks.size();
	}

	@Override
	public Object getItem(int position) {
		// TODO Auto-generated method stub
		return mBooks.get(position);
	}

	@Override
	public long getItemId(int position) {
		// TODO Auto-generated method stub
		return 0;
	}
	
	
	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		// TODO Auto-generated method stub
		ViewHolder holder = null;
		if(convertView==null){
			holder = new ViewHolder();
			convertView = mLayoutInflater.inflate(R.layout.main_view_index_recommod_adapter_item, null);
			convertView.setTag(holder);
		}else{
			holder = (ViewHolder)convertView.getTag();
		}
		
		return convertView;
	}
	
	class ViewHolder {
		ImageView book1;
		ImageView text;
		TextView bookName;
		TextView bookreadInfo;
		RelativeLayout download;
	}
	
	
}
